
package Merlion.CRM.entity;

import Merlion.SCM.entity.PickingOrderEntity;
import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Temporal;

@Entity
public class DeliveryOrderEntity implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    private String status;
    private String shippingMethod;
    private String shippingRule;
    private String shippingCompany;
    private String deleteFlag;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date dueDate;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date dateIssued;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date checkBy;
    private String freightCostRule;
    private double freightCost;
    private double totalPrice;
    private String description;
    private String pricingType;
    private String paymentMethod;
    private String documentName;
    private boolean executed;
    @OneToMany
    private List<LineEntryEntity> lineEntryList;
    @OneToOne
    private BillingAddressEntity billingAddress;
    @OneToOne
    private ShippingAddressEntity shippingAddress;
    @ManyToOne
    private CustomerEntity customer;
    @ManyToOne
    private ContactEntity contact;
    @ManyToOne
    private SalesOrderEntity salesOrder;
    @OneToOne
    private PickingOrderEntity pickingOrderEntity;

    public DeliveryOrderEntity() {
    }

    public void create(Date dateIssued, Date dueDate, Date checkBy,
            String shippingMethod, String shippingRule, String freightCostRule,
            List<LineEntryEntity> lineEntryList, BillingAddressEntity billingAddress, ShippingAddressEntity shippingAddress,
            CustomerEntity customer) {
        this.setShippingMethod(shippingMethod);
        this.setShippingRule(shippingRule);
        // this.setFreightCost(freightCost);
        this.setFreightCostRule(freightCostRule);
        this.setLineEntryList(lineEntryList);
        this.setBillingAddress(billingAddress);
        this.setShippingAddress(shippingAddress);
        this.setCustomer(customer);
        this.setDateIssued(dateIssued);
        this.setDueDate(dueDate);
        this.setCheckBy(checkBy);

    }

    public ContactEntity getContact() {
        return contact;
    }

    public void setContact(ContactEntity contact) {
        this.contact = contact;
    }

    public SalesOrderEntity getSalesOrder() {
        return salesOrder;
    }

    public void setSalesOrder(SalesOrderEntity salesOrder) {
        this.salesOrder = salesOrder;
    }

    public BillingAddressEntity getBillingAddress() {
        return billingAddress;
    }

    public void setBillingAddress(BillingAddressEntity billingAddress) {
        this.billingAddress = billingAddress;
    }

    public CustomerEntity getCustomer() {
        return customer;
    }

    public void setCustomer(CustomerEntity customer) {
        this.customer = customer;
    }

    public List<LineEntryEntity> getLineEntryList() {
        lineEntryList.size();
        return lineEntryList;
    }

    public void setLineEntryList(List<LineEntryEntity> lineEntryList) {
        this.lineEntryList = lineEntryList;
    }

    public ShippingAddressEntity getShippingAddress() {
        return shippingAddress;
    }

    public void setShippingAddress(ShippingAddressEntity shippingAddress) {
        this.shippingAddress = shippingAddress;
    }

    public Date getCheckBy() {
        return checkBy;
    }

    public void setCheckBy(Date checkBy) {
        this.checkBy = checkBy;
    }

    public PickingOrderEntity getPickingOrderEntity() {
        return pickingOrderEntity;
    }

    public void setPickingOrderEntity(PickingOrderEntity pickingOrderEntity) {
        this.pickingOrderEntity = pickingOrderEntity;
    }

    public Date getDateIssued() {
        return dateIssued;
    }

    public void setDateIssued(Date dateIssued) {
        this.dateIssued = dateIssued;
    }

    public String getDeleteFlag() {
        return deleteFlag;
    }

    public void setDeleteFlag(String deleteFlag) {
        this.deleteFlag = deleteFlag;
    }

    public Date getDueDate() {
        return dueDate;
    }

    public void setDueDate(Date dueDate) {
        this.dueDate = dueDate;
    }

    public double getFreightCost() {
        return freightCost;
    }

    public void setFreightCost(double freightCost) {
        this.freightCost = freightCost;
    }

    public String getFreightCostRule() {
        return freightCostRule;
    }

    public void setFreightCostRule(String freightCostRule) {
        this.freightCostRule = freightCostRule;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getShippingCompany() {
        return shippingCompany;
    }

    public void setShippingCompany(String shippingCompany) {
        this.shippingCompany = shippingCompany;
    }

    public String getShippingMethod() {
        return shippingMethod;
    }

    public void setShippingMethod(String shippingMethod) {
        this.shippingMethod = shippingMethod;
    }

    public String getShippingRule() {
        return shippingRule;
    }

    public void setShippingRule(String shippingRule) {
        this.shippingRule = shippingRule;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public double getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(double totalPrice) {
        this.totalPrice = totalPrice;
    }

    public String getPaymentMethod() {
        return paymentMethod;
    }

    public void setPaymentMethod(String paymentMethod) {
        this.paymentMethod = paymentMethod;
    }

    public String getPricingType() {
        return pricingType;
    }

    public void setPricingType(String pricingType) {
        this.pricingType = pricingType;
    }

    public String getDocumentName() {
        return documentName;
    }

    public void setDocumentName(String documentName) {
        this.documentName = documentName;
    }

    public boolean isExecuted() {
        return executed;
    }

    public void setExecuted(boolean executed) {
        this.executed = executed;
    }
}